package com.foxit.pdf2html5.common.intergration;

/**
 * @author Shaojie Zhuo
 * Cache description handle.
 */
public class CacheDescriptionHandle {
	
	/**
	 * @return description of manifest cache item.
	 */
	public static String getManifestInfoCacheDescription()
	{
		return CacheDescription.ManifestInfo;
	}
	
	/**
	 * @return description of annotation cache item.
	 */
	public static String getAnnnosCacheDescription()
	{
		return CacheDescription.AnnotationInfo;
	}
	
	/**
	 * @return description of bookmark cache item.
	 */
	public static String getBookmarksCacheDescription()
	{
		return CacheDescription.BookmarkInfo;
	}
	
	/**
	 * @param pageIndex page index. 
	 * @param fZoom zoom of page.
	 * @param isForm whether the PDF file is a form.
	 * @return description of page image cache item.
	 */
	public static String getPageImageCacheDescription(int pageIndex, float fZoom, boolean isForm)
	{
		String description = String.format(CacheDescription.PageImage,pageIndex,(int)(fZoom*100),isForm? 1: 0);
		return description;
	}
	
	/**
	 * @param pageIndex page index.
	 * @return description of page text cache item.
	 */
	public static String getPageTextCacheDescription(int pageIndex)
	{
		String description = String.format(CacheDescription.TextInfo,pageIndex);
		return description;
	}
	
	/**
	 * @param pageIndex page index
	 * @return description of form image cache item.
	 */
	public static String getFormImageCacheDescription(int pageIndex)
	{
		String description = String.format(CacheDescription.FormImage,pageIndex);
		return description;
	}
	
	/**
	 * @param pageIndex page index.
	 * @return description of page xml information cache item.
	 */
	public static String getFormXmlInfoCacheDescription(int pageIndex)
	{
		String description = String.format(CacheDescription.FormXmlInfo,pageIndex);
		return description;
	}
}
